<table class="table table-bordered">
    <thead>
    <tr>
        <th width="5%">提问ID</th>
        <th width="5%">涉及品牌</th>
        <th width="5%">问题标签</th>
        <th width="8%">问题概览</th>
        <th width="6%">提问用户ID</th>
        <th width="5%">提问用户</th>
        <th width="6%">回答用户ID</th>
        <th width="5%">回答用户</th>
        <th width="4%">回答数</th>
        <th width="6%">付费金额（元）</th>
        <th width="5%">采纳状态</th>
        <th width="5%">提问状态</th>
        <th width="5%">是否举报</th>
        <th width="9%">提问时间</th>
        <th width="4%">PV</th>
        <th width="4%">昨日UV</th>
        <th width="7%">操作</th>
    </tr>
    </thead>
    <tbody>
    <volist name="list" id="row" key="k">
        <tr class="listBg">
            <td>{$row.question_id}</td>
            <td>{$row.brand_name}</td>
            <td>
                <select class="category" data="{$row.question_id}">
                    <volist name="category" id="vo">
                        <if condition="$row['question_category'] eq $vo['id']">
                            <option selected="selected" value="{$vo.id}">{$vo.category_name}</option>
                            <else/>
                            <option value="{$vo.id}">{$vo.category_name}</option>
                        </if>
                    </volist>
                </select>
            </td>
            <td>{$row.content}</td>
            <td>{$row.user_id}</td>
            <td>{$row.user_name}</td>
            <td>{$row.expert_id}</td>
            <td>{$row.expert_name}</td>
            <td>{$row.answer_num}</td>
            <td>{$row.reward_price}</td>
            <td>{$row.accept_status}</td>
            <td>{$row.question_status}</td>
            <td>
                <if condition="$row.report_num gt 0">
                    是
                    <else />
                    否
                </if>
            </td>
            <td>{$row.create_time}</td>
            <td>{$row.pv}</td>
            <td>{$row.uv}</td>
            <td>
                <a href="{:U('PayQuestion/payQuestionInfo',['id'=>$row['question_id']])}"
                   target="_blank">查看</a><br/>
                <if condition="$row.status eq 1">
                    <if condition="$row.is_top eq 1">
                        <a href="#" onclick="return  q_top({$row['question_id']},0);">取消推荐</a><br/>
                        <else/>
                        <a href="#" onclick="return  q_top({$row['question_id']},1);">推荐</a><br/>
                    </if>
                    <a href="#" onclick="return q_disable({$row['question_id']},3)">违规禁用</a><br/>
                    <a href="#" onclick="return q_disable({$row['question_id']},4)">用户禁用</a><br/>
                    <if condition="$row.pay_state eq 1">
                        <a href="#" onclick="return activate_refund({$row['question_id']})">激活退款</a><br/>
                    </if>
                    <elseif condition="$row.status neq 2"/>
                    <!--<a href="#" onclick="return q_disable({$row['question_id']},1)">启用</a><br/>-->
                    <if condition="$row.pay_state eq 1">
                        <a href="#" onclick="return activate_refund({$row['question_id']})">激活退款</a><br/>
                    </if>
                </if>

            </td>
        </tr>
    </volist>
    </tbody>
</table>
<div class="pageFaye">
    <div class="pager">{$page}</div>
    <div class="clear"></div>
</div>
<script>
    $(function(){
        $('.category').change(function () {
            var id = $(this).attr('data');
            if (!id) {
                return false;
            }
            var category = $(this).val();
            if (!category) {
                return false;
            }

            $.post('/CommonQuestion/changeCategory', {question_id:id, category_id:category}, function(data){
                if (data.code == '200') {
                    alert(data.msg);
                } else {
                    alert(data.msg);
                }
            }, 'json');
        });
    });

</script>